#!/usr/bin/node

const url = require('url'),
      log = console.log,
      qs = require('querystring');

let addr = 'http://wangding:123@www.baidu.com:8080/a/b/c?age=20&gender=M#/d/e/f';

addr = url.parse(addr);
log(addr.protocol);
log(addr.username);
log(addr.psssword);
log(addr.hostname);
log(addr.port);
log(addr.pathname);
log(addr.query);
log(addr.hash);
log(qs.parse(addr.query));
